﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Frogs.Stability.LeakyBucket;

namespace Frogs.Stability.Tests
{
	class MockBucketTimer : IBucketTimer
	{
		public void Start()
		{
			this.IsRunning = true;
		}

		public void Stop()
		{
			this.IsRunning = false;
		}

		public double Interval {get;set;}

		public event BucketTimerElapsedEventHandler Elapsed;
		public void SendElapsed()
		{
			var tmp = this.Elapsed;
			if (tmp != null)
			{
				tmp(this, new EventArgs());
			}
			else
			{
				throw new Exception("Elapsed not set");
			}
		}

		public bool IsRunning { get; set; }
	}
}
